Skip to content

fix(models): create immutable defaults per instance - #113

Draft
marlon-costa-dc wants to merge 1 commit into
0.12.0-devfrom
fix/pipeline-mapping-defaults
Draft

fix(models): create immutable defaults per instance#113
marlon-costa-dc wants to merge 1 commit into
0.12.0-devfrom
fix/pipeline-mapping-defaults

Conversation

@marlon-costa-dc

@marlon-costa-dc marlon-costa-dc commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Root cause

Pydantic deep-copied shared MappingProxyType defaults while constructing a failed PipelineStageResult, raising cannot pickle mappingproxy and hiding the original stage failure. A callable PrivateAttr default also acted as a descriptor and ignored the typed test consumer override.

Change

  • create immutable mapping defaults through one canonical factory per mapping type
  • use those factories across all model consumers
  • keep stage exceptions fail-loud and remove the contradictory normalization test
  • expose getpass through a non-descriptor callable adapter
  • apply the repository formatter to pre-existing drift encountered by the blocking gate

Evidence so far

  • make setup: exit 0
  • make fmt WHAT=check: 346 files formatted, exit 0
  • make check WHAT=all: 7/7 gates green, 0 skipped
  • make test WHAT=all: 937 passed, 27 deselected by Testmon, exit 0
  • focused failed-stage runtime: 1 passed
  • focused password runtime: 1 passed

Remaining before ready: deps check, generation check/idempotence, CI-mode tests.


Summary by cubic

Fixes model defaults so failed pipeline stages report their real error instead of a cannot pickle mappingproxy exception. Pydantic's deep copy of the shared MappingProxyType defaults masked the original stage failure.

  • Replaces shared empty mapping defaults with per-instance factory functions across all model consumers.
  • Wraps getpass.getpass in a non-descriptor callable so the typed password reader override is applied.
  • Removes the test asserting raised handlers produce a failed pipeline result; exceptions now surface directly.
  • Applies the repository formatter to pre-existing drift.

Written for commit c0e6fcb. Summary will update on new commits.

Review in cubic

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant